home *** CD-ROM | disk | FTP | other *** search
/ SGI Freeware 1999 August / SGI Freeware 1999 August.iso / dist / fw_tkcvs.idb / usr / freeware / bin / tkcvs.z / tkcvs
Encoding:
Text File  |  1999-04-16  |  9.6 KB  |  299 lines

  1. #!/usr/freeware/bin/wish -f
  2.  
  3. #
  4. # $Id: tkcvs.blank,v 1.22 1995/11/22 00:24:50 davide Exp $
  5. #
  6. # tkCVS Main program -- A Tk interface to CVS.
  7. #
  8. # Uses a structured modules file -- see the manpage for more details.
  9. #
  10. # Author:  Del (del@babel.dialix.oz.au)
  11. #
  12.  
  13. #
  14. # Constants for user configuration
  15. #
  16. # Change these two variables to point to your bitmaps directories.
  17. set global_bitmapdir "/usr/include/X11/bitmaps"
  18. set local_bitmapdir "/usr/freeware/lib/tkcvs/bitmaps"
  19. set cvscfg(editor) "nedit"
  20. set cvscfg(editorargs) {}
  21.  
  22. set auto_path [linsert $auto_path 0 /usr/freeware/lib/tkcvs]
  23.  
  24. set cvscfg(allfiles) 0
  25. set cvscfg(tagmissing) 0
  26. set cvscfg(checkrecursive) {}
  27.  
  28. set maxdirs 15
  29. set dirlist {}
  30. set totaldirs 0
  31.  
  32.  
  33. # Read in defaults
  34. if [file exists /usr/freeware/lib/tkcvs/tkcvs_def.tcl] {
  35.   # catch {source /usr/freeware/lib/tkcvs/tkcvs_def.tcl}
  36.   source /usr/freeware/lib/tkcvs/tkcvs_def.tcl
  37. }
  38. if [file exists ~/.tkcvs] {
  39.   # catch {source ~/.tkcvs}
  40. }
  41.  
  42. if {$cvscfg(papersize) == "A4"} {
  43.   set cvscfg(ystart) 770
  44.   set cvscfg(yend) 60
  45.   set cvscfg(xstart) 25
  46.   set cvscfg(xend) 580
  47. } else {
  48.   set cvscfg(ystart) 700
  49.   set cvscfg(yend) 60
  50.   set cvscfg(xstart) 25
  51.   set cvscfg(xend) 580
  52. }
  53.  
  54. set cwd [pwd]
  55. set incvs 0
  56.  
  57. frame .menubar -relief raised -border 2
  58. pack .menubar -side top -fill x
  59.  
  60. #
  61. # Setup any necessary toplevels
  62. #
  63.  
  64. read_modules_setup
  65. import_setup
  66. commit_setup
  67. tag_setup
  68. search_setup
  69. update_setup
  70. merge_setup
  71. venselect_setup
  72. checkout_setup
  73. workdir_setup
  74. reports_setup
  75.  
  76. #
  77. # Create the Menu bar
  78. #
  79.  
  80. menubutton .menubar.file -text File -underline 0 -menu .menubar.file.m
  81. menubutton .menubar.reports -text Reports -underline 0 -menu .menubar.reports.m
  82. menubutton .menubar.search -text Search -underline 0 -menu .menubar.search.m
  83. menubutton .menubar.options -text Options -underline 0 -menu .menubar.options.m
  84. menubutton .menubar.help -text Help -underline 0 -menu .menubar.help.m
  85. pack .menubar.file .menubar.reports .menubar.search .menubar.options -side left
  86. if { [info exists cvsmenu] || [info exists usermenu] } {
  87.   menubutton .menubar.user -text "User Defined" -underline 0 \
  88.     -menu .menubar.user.m
  89.   pack .menubar.user -side left
  90.   # puts stderr "Adding user defined menu."
  91. }
  92. menubutton .menubar.goto -text "Go" -underline 0 -menu .menubar.goto.m
  93. pack .menubar.goto -side left
  94. pack .menubar.help -side right
  95.  
  96. #
  97. # Create Menus
  98. #
  99.  
  100. menu .menubar.file.m
  101. .menubar.file.m add command -label "Open"    -underline 0 \
  102.   -command { workdir_act_on_file [workdir_list_marked_files] }
  103. .menubar.file.m add command -label "Delete"  -underline 0 \
  104.   -command { workdir_delete_file [workdir_list_marked_files] }
  105. .menubar.file.m add command -label "Cleanup" -underline 0 \
  106.   -command { workdir_cleanup }
  107. .menubar.file.m add separator
  108. .menubar.file.m add command -label "Print"   -underline 0 \
  109.   -command { workdir_print_file  [workdir_list_marked_files ] }
  110. .menubar.file.m add separator 
  111. .menubar.file.m add command -label "Import ..." -underline 0 \
  112.   -command import_run
  113. .menubar.file.m add command -label "Create Dir ..." -underline 7 \
  114.   -command inewdir_run
  115. .menubar.file.m add separator
  116. .menubar.file.m add command -label "Tag Files ..." -underline 0 \
  117.   -command tag_run
  118. .menubar.file.m add separator
  119. .menubar.file.m add command -label "Update" -underline 0 \
  120.   -command {
  121.     eval "cvs_update {} [workdir_list_marked_files]"
  122.   }
  123. .menubar.file.m add command -label "Update to Tag ..." \
  124.   -command update_run
  125. .menubar.file.m add separator
  126. .menubar.file.m add command -label "Module Level Merge" \
  127.   -command merge_run
  128. .menubar.file.m add command -label "Module Level Difference" \
  129.   -command notyet
  130. .menubar.file.m add separator
  131. .menubar.file.m add command -label "Add Files" \
  132.   -command {
  133.     eval "cvs_add [workdir_list_marked_files]"
  134.   }
  135. .menubar.file.m add command -label "Remove Files" \
  136.   -command {
  137.     eval "cvs_remove [workdir_list_marked_files]"
  138.   }
  139. .menubar.file.m add command -label "Log Browse ..." \
  140.   -command {
  141.     eval "cvs_logcanvas [workdir_list_marked_files]"
  142.   }
  143. .menubar.file.m add command -label "Check In ..." \
  144.   -command commit_run
  145. .menubar.file.m add command -label "Check Out ..." \
  146.   -command checkout_run
  147. .menubar.file.m add separator
  148. .menubar.file.m add command -label Exit -underline 1 \
  149.   -command exit
  150.  
  151. menu .menubar.reports.m
  152. .menubar.reports.m add command -label "CVS check ..." \
  153.   -underline 4 \
  154.   -command cvs_check
  155. .menubar.reports.m add command -label "CVS status ..." \
  156.   -underline 4 \
  157.   -command {
  158.     eval "cvs_status [workdir_list_marked_files]"
  159.   }
  160. .menubar.reports.m add command -label "CVS diff ..." \
  161.   -underline 4 \
  162.   -command {
  163.     eval "cvs_diff [workdir_list_marked_files]"
  164.   }
  165. .menubar.reports.m add command -label "CVS log ..." \
  166.   -underline 4 \
  167.   -command {
  168.     eval "cvs_log [workdir_list_marked_files]"
  169.   }
  170. .menubar.reports.m add separator
  171. .menubar.reports.m add command -label "Module Tree ..." \
  172.   -underline 7 \
  173.   -command {modlist_by_code "." 0 "head"}
  174. .menubar.reports.m add command -label "Modules Sorted by Name ..." \
  175.   -underline 18 \
  176.   -command {modlist_by_name 0 "head"}
  177. .menubar.reports.m add command -label "Version Tree ..." \
  178.   -command {modlist_by_code "." 1 "head"}
  179. .menubar.reports.m add command -label "Version Listing by Name ..." \
  180.   -command {modlist_by_name 1 "head"}
  181.  
  182. menu .menubar.search.m
  183. .menubar.search.m add command -label "Search Repository by Code ..." \
  184.   -underline 21 \
  185.   -command code_search
  186. .menubar.search.m add command -label "Search Repository by Name ..." \
  187.   -underline 21 \
  188.   -command name_search
  189. .menubar.search.m add command -label "Search Repository by Keyword ..." \
  190.   -underline 21 \
  191.   -command keyword_search
  192.  
  193. menu .menubar.options.m
  194. .menubar.options.m add checkbutton -label "Show hidden files" \
  195.   -variable cvscfg(allfiles) -onvalue 1 -offvalue 0 \
  196.   -command setup_dir
  197. .menubar.options.m add checkbutton -label "Check recursively" \
  198.   -variable cvscfg(checkrecursive) -onvalue {} -offvalue -l 
  199. .menubar.options.m add checkbutton -label "Show untagged files in tag reports" \
  200.   -variable cfscfg(tagmissing) -onvalue 1 -offvalue 0
  201. .menubar.options.m add checkbutton -label "Automatic directory status" \
  202.   -variable cvscfg(auto_status) -onvalue "true" -offvalue "false" \
  203.   -command setup_dir
  204. .menubar.options.m add checkbutton -label "Apply Recursively" \
  205.   -variable cvscfg(recurse) -onvalue "true" -offvalue "false" 
  206. .menubar.options.m add separator
  207. .menubar.options.m add cascade -label "CVS Status Detail" \
  208.   -menu .menubar.options.m.report_detail
  209. .menubar.options.m add cascade -label "CVS Log Detail" \
  210.   -menu .menubar.options.m.logfile_detail
  211.  
  212. menu .menubar.options.m.report_detail
  213. .menubar.options.m.report_detail add radiobutton -label "Verbose" \
  214.   -variable cvscfg(rdetail) -value "verbose"
  215. .menubar.options.m.report_detail add radiobutton -label "Summary" \
  216.   -variable cvscfg(rdetail) -value "summary"
  217. .menubar.options.m.report_detail add radiobutton -label "Terse" \
  218.   -variable cvscfg(rdetail) -value "terse"
  219.  
  220. menu .menubar.options.m.logfile_detail
  221. .menubar.options.m.logfile_detail add radiobutton -label "Verbose" \
  222.   -variable cvscfg(ldetail)  -value "verbose"
  223. .menubar.options.m.logfile_detail add radiobutton -label "Summary" \
  224.   -variable cvscfg(ldetail) -value "summary"
  225. .menubar.options.m.logfile_detail add radiobutton -label "Last Entry Only" \
  226.   -variable cvscfg(ldetail) -value "last"
  227.  
  228. menu .menubar.goto.m
  229. .menubar.goto.m add command -label "Home" \
  230.    -command {change_dir ~}
  231.  
  232. menu .menubar.help.m
  233. .menubar.help.m add command -label "About tkCVS ..." -underline 0 \
  234.   -command aboutbox
  235. .menubar.help.m add command -label "About CVS ..." -underline 6 \
  236.   -command cvs_version
  237. .menubar.help.m add separator
  238. .menubar.help.m add command -label "Working with tkCVS ..." \
  239.   -command working_with_tkcvs
  240. .menubar.help.m add command -label "Checking out Modules ..." \
  241.   -command checking_out_modules
  242. .menubar.help.m add command -label "Exporting ..." \
  243.   -command exporting
  244. .menubar.help.m add command -label "Tagging and Branching ..." \
  245.   -command tagging_and_branching
  246. .menubar.help.m add command -label "Importing New Modules ..." \
  247.   -command importing_new_modules
  248. .menubar.help.m add separator
  249. .menubar.help.m add command -label "Current Directory Display ..." \
  250.   -command current_directory
  251. .menubar.help.m add command -label "Buttons ..." \
  252.   -command buttons_help
  253. .menubar.help.m add separator
  254. .menubar.help.m add command -label "Module Browser ..." \
  255.   -command module_browser
  256. .menubar.help.m add command -label "File Browser ..." \
  257.   -command file_browser
  258. .menubar.help.m add command -label "Log Browser ..." \
  259.   -command log_browser
  260. .menubar.help.m add separator
  261. .menubar.help.m add command -label "Configuration Files ..." \
  262.   -command configuration_files
  263. .menubar.help.m add command -label "Environment Variables ..." \
  264.   -command environment_variables
  265. .menubar.help.m add command -label "User Defined Menu ..." \
  266.   -command user_defined_menu
  267. .menubar.help.m add command -label "CVS modules File ..." \
  268.   -command cvs_modules_file
  269.  
  270. #
  271. # Add user commands to the menu.
  272. #
  273. if { [info exists cvsmenu] || [info exists usermenu] } {
  274.   menu .menubar.user.m
  275. }
  276. if [info exists cvsmenu] {
  277.   foreach item [array names cvsmenu] {
  278.     .menubar.user.m add command -label $item \
  279.       -command "eval cvs_usercmd $cvsmenu($item) \[workdir_list_marked_files\]"
  280.   }
  281. }
  282. if [info exists usermenu] {
  283.   .menubar.user.m add separator
  284.   foreach item [array names usermenu] {
  285.     .menubar.user.m add command -label $item \
  286.       -command "eval cvs_anycmd $usermenu($item) \[workdir_list_marked_files\]"
  287.   }
  288. }
  289.  
  290.  
  291. # Window manager stuff.
  292. wm title . "tkCVS"
  293. wm iconname . "CVS"
  294. wm iconbitmap . @$local_bitmapdir/tkcvs32.xbm
  295. wm iconmask . @$local_bitmapdir/tkcvs32_mask.xbm
  296.  
  297. wm maxsize . 100 [expr $cvscfg(y_size) * 3]
  298. wm minsize . 0  [expr $cvscfg(y_size) / 3]
  299.